/**
 * 
 */
package pl.softech.gpw.dao;

import java.io.IOException;
import java.util.Collection;

import pl.softech.gpw.dao.ds.RemoteBossaDataSource;
import pl.softech.gpw.dao.ds.Utils;
import pl.softech.gpw.model.FInstrument;

/**
 * @author ssledz
 *
 */
public class RealTimeBossaDao {

	private final RemoteBossaDataSource realTimePrimaryDataSource;
	private final BossaParser parser;
	
	public RealTimeBossaDao(RemoteBossaDataSource realTimePrimaryDataSource) {
		this.realTimePrimaryDataSource = realTimePrimaryDataSource;
		this.parser = new BossaParser();
	}
	
	public Collection<FInstrument> getRealTimeInstruments() throws ParseException, IOException {
		return parser.getInstruments(Utils.getInputStream(realTimePrimaryDataSource));
	}
	
	
}
